<?php
class ControllerCommonHome extends Controller {
	public function index() {
		$this->document->setTitle($this->config->get('config_meta_title'));
		$this->document->setDescription($this->config->get('config_meta_description'));
		$this->document->setKeywords($this->config->get('config_meta_keyword'));
		$this->document->addSeoMeta('<meta name="robots" content="index, follow"/>'."\n");

		if (isset($this->request->get['route'])) {
			$this->document->addLink($this->config->get('config_url'), 'canonical');
		}

		$data['column_left'] = $this->load->controller('common/column_left');
		$data['column_right'] = $this->load->controller('common/column_right');
		$data['content_top'] = $this->load->controller('common/content_top');
		$data['content_bottom'] = $this->load->controller('common/content_bottom');
		$data['footer'] = $this->load->controller('common/footer');
		$data['header'] = $this->load->controller('common/header');

        //微数据
        $json = array();
        $json['@context'] = 'https://schema.org';
        $json['@type'] = 'WebSite';
        $json['url'] = 'https://www.irugbystore.com';
        $json['name'] = 'IrugbyStore';
        $json['potentialAction'] = array(
            '@type' => 'SearchAction',
            'target' => 'https://www.irugbystore.com/search?search={search_term_string}',
            'query-input' => 'required name=search_term_string',
        );
        $data['structured_data'] = '<script type="application/ld+json">'.json_encode($json).'</script>'."\n";

        $json = array();
        $json['@context'] = 'https://schema.org';
        $json['@type'] = 'Organization';
        $json['name'] = 'IrugbyStore';
        $json['url'] = 'https://www.irugbystore.com';
        $json['logo'] = 'https://www.irugbystore.com/image/catalog/irugbystore-logo.png';
        $json['contactPoint'] = array(
            "@type"=> "ContactPoint",
            "telephone"=> "+86-15985837392",
            "contactType"=> "Customer Service",
            "areaServed"=> "US",
            "availableLanguage"=> ["English", "French"]
        );
        $json['sameAs'] = array();
        $data['structured_data'] .= '<script type="application/ld+json">'.json_encode($json).'</script>'."\n";

		$this->response->setOutput($this->load->view('common/home', $data));
	}
}
